<!DOCTYPE html>
<!--
     SPDX-License-Identifier: CC-BY-SA-4.0
     SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC.
-->
<!-- Page last generated 2025-02-20 03:16:15 +0000 -->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>RockPro64 | seL4 docs</title>

    <!-- Our stylesheet and theme stylesheet.  Contains bootstrap. -->
    <link rel="stylesheet" href="/assets/css/style.css" type="text/css">
    <!-- Font awesome -->
    <link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
    <!-- Pygments syntax highlighting  -->
    <link rel="stylesheet" href="/assets/css/highlighting/trac.css" type="text/css">
    <link rel="icon" type="image/x-icon" href="/assets/favicon.ico"><script defer data-domain="docs.sel4.systems"
	    src="https://analytics.sel4.systems/js/script.js"></script></head>

  <body class="container-fluid">

    



<header>
  <ul class="row menu">
    <li class="col-xs-12 col-md-2" >
            <a href="https://sel4.systems" class="skip-icon">
              <img class="img-responsive" src="/assets/logo-text-white.svg" alt="seL4 logo" />
            </a>
    </li>
    <li class="col-xs-12 col-md-10 menu">
      <nav aria-label="Banner links">
        <h2><a href="/Resources" />Resources</h2>
        <h2><a href="/processes" />Contributing</a></h2>
        <h2><a href="/projects" />Projects</h2>
        <h2><a href="/Tutorials" />Tutorials</h2>
        <iframe title="DuckDuckGo search bar" src="https://duckduckgo.com/search.html?site=docs.sel4.systems&prefill=Search%20sel4.systems" style="overflow:hidden;margin-bottom:10px; padding:0;height:40px;float:right;border-width: 0px"></iframe>
      </nav>
    </li>
  </ul>
  <div class="clear"></div>
  
<div class="breadcrumbs bootstrap hidden-sm-down">
  <nav class="sel-breadcrumb" aria-label="Breadcrumb" >
    <ol class=" list-unstyled" vocab="http://schema.org/" typeof="BreadcrumbList">
      
      
        

        

        <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <a property="item" typeof="WebPage" href="/">
              <span property="name"><b>seL4 Docs</b></span>
            </a>
            <meta property="position" content="1" />
        </li>
      
        

        

        <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <a property="item" typeof="WebPage" href="/Hardware/">
              <span property="name"><b>Supported platforms</b></span>
            </a>
            <meta property="position" content="2" />
        </li>
      
        

        
          <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <span property="name">RockPro64</span>
            <meta property="position" content="3" /></li>
          
    </ol>
  </nav>
  <nav class="sel-version" aria-label="Current Versions">
    <ol class="list-unstyled">
      <li class="list-unstyled text-right" style="margin-left:auto; padding:0rem 0rem;">
        Current versions:</li>
      <li class="list-unstyled text-right">
      <a href="/releases/sel4/13.0.0"><b>seL4-13.0.0</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/microkit/1.4.1"><b>microkit-1.4.1</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/camkes/camkes-3.11.0"><b>camkes-3.11.0</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/capdl/0.3.0"><b>capDL-0.3.0</b></a></li>
      </ol>
  </nav>
  <div class='clear'></div>
</div>


</header>

    <main>
      <div class="row">
  <div class="hidden-xs col-sm-4 col-md-3 col-lg-2">
    


<div class="sidebar">
















</div>

  </div>
  <div class="col-sm-8 col-md-9 col-lg-8 main">
    
      <nav aria-label="Table of Contents">
        <ul id="toc" class="section-nav">
<li class="toc-entry toc-h2"><a href="#building-sel4test">Building seL4test</a></li>
<li class="toc-entry toc-h2"><a href="#flashing-the-spi-with-u-boot">Flashing the SPI with U-Boot</a></li>
<li class="toc-entry toc-h2"><a href="#setting-up-with-tftp-dhcp-uefi-recommended">Setting up with TFTP, DHCP, UEFI (recommended!)</a>
<ul>
<li class="toc-entry toc-h3"><a href="#manual-method-well-tested">Manual method (well tested)</a></li>
<li class="toc-entry toc-h3"><a href="#automated-method">Automated method</a></li>
<li class="toc-entry toc-h3"><a href="#building-things">Building things</a></li>
</ul>
</li>
<li class="toc-entry toc-h2"><a href="#setting-up-with-uefi-sd-card">Setting up with UEFI, SD card</a>
<ul>
<li class="toc-entry toc-h3"><a href="#manual">Manual</a></li>
<li class="toc-entry toc-h3"><a href="#automated">Automated</a></li>
</ul>
</li>
</ul>
      </nav>
    
    <div class="content">
      <h1 id="rockpro64">RockPro64</h1>

<h2 id="building-sel4test">Building seL4test</h2>

<p>Checkout the sel4test project using repo as per <a href="/seL4Test">seL4Test</a></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>repo init <span class="nt">-u</span> https://github.com/seL4/sel4test-manifest.git
repo <span class="nb">sync
mkdir </span>cbuild
<span class="nb">cd </span>cbuild
../init-build.sh <span class="nt">-DPLATFORM</span><span class="o">=</span>rockpro64 <span class="nt">-DAARCH64</span><span class="o">=</span>1
<span class="c"># The default cmake wrapper sets up a default configuration for the target platform.</span>
<span class="c"># To change individual settings, run `ccmake` and change the configuration</span>
<span class="c"># parameters to suit your needs.</span>
ninja

</code></pre></div></div>

<p>Generated binaries can be found in the <code class="language-plaintext highlighter-rouge">images/</code> directory.</p>

<h2 id="flashing-the-spi-with-u-boot">Flashing the SPI with U-Boot</h2>

<p><strong>WARNING! DO NOT POWER OFF THE DEVICE FOR ANY REASON DURING SPI FLASH! YOU WILL GET A (soft-) BRICKED DEVICE</strong></p>

<p>The first step is getting U-Boot onto the system. It is recommended, particularly for TFTP boot, to put U-Boot on the SPI flash.</p>

<p>If you have a “dirty” (any previously used) SPI flash, first:</p>
<ol>
  <li>Download https://github.com/sigmaris/u-boot/releases/download/v2020.01-ci/erase_spi.img.gz</li>
  <li>Write it to an SD card</li>
  <li>Boot from the SD card (will be done automatically if you don’t have a very weird setup). Once it completes (see this over serial or when white LED becomes stable), remove the SD card, but DO NOT reset.</li>
</ol>

<p>Then, to flash the actual image:</p>
<ol>
  <li>Get https://github.com/sigmaris/u-boot/releases/download/v2020.01-ci/flash_spi.img.gz and write it to an SD card.</li>
  <li>Put the SD card into the rockpro64 and boot. Wait for completion (seen over serial or when white LED becomes stable).</li>
  <li>Remove the SD card.</li>
  <li>Reset and observe U-Boot come up.</li>
</ol>

<p>Compiling u-boot onesself has not been done and has been left as an exercise to the reader if wanted. HINT: https://github.com/sigmaris/u-boot/blob/v2020.01-ci/.azure-pipelines.yml. This fork is used as it resolves a number of issues present in mainline U-Boot and has pre-built images.</p>

<h2 id="setting-up-with-tftp-dhcp-uefi-recommended">Setting up with TFTP, DHCP, UEFI (recommended!)</h2>

<p>I assume you have:</p>
<ul>
  <li>setup a TFTP server</li>
  <li>setup a DHCP server</li>
  <li>linked the TFTP and DHCP servers appropriately</li>
</ul>

<p>Luckily the U-Boot defconfig for rockpro64 includes UEFI support. We are not using EDK2 because no stable and tested implementations exist for rockpro64.</p>

<p>Copy your seL4 image to the TFTP root under the name <code class="language-plaintext highlighter-rouge">sel4img</code> (or any other name of your choosing but you will have to adjust following commands).</p>

<h3 id="manual-method-well-tested">Manual method (well tested)</h3>

<p>Drop into a U-Boot console when asked. Type in:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dhcp
tftpboot ${kernel_addr_r} sel4img
bootefi ${kernel_addr_r}
</code></pre></div></div>

<ul>
  <li>Watch seL4 boot!</li>
</ul>

<h3 id="automated-method">Automated method</h3>

<p>Create <code class="language-plaintext highlighter-rouge">pxelinux.cfg/default</code> in TFTP root:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>menu title PXE!

timeout 200

label sel4
menu default
kernel /sel4img
</code></pre></div></div>

<p>Create <code class="language-plaintext highlighter-rouge">boot.scr</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bootefi 0x2080000
</code></pre></div></div>

<p>Significance of 0x2080000 being where seL4 image is loaded by U-Boot.</p>

<p>Convert <code class="language-plaintext highlighter-rouge">boot.scr</code> to a uImage using <code class="language-plaintext highlighter-rouge">mkimage -A arm -T script -C none -n boot.scr -d boot.scr boot.scr.uimg</code>. Ensure <code class="language-plaintext highlighter-rouge">boot.scr.uimg</code> is in the TFTP root and <code class="language-plaintext highlighter-rouge">boot.scr</code> is removed.</p>

<h3 id="building-things">Building things</h3>

<p>Ensure your <code class="language-plaintext highlighter-rouge">tools/seL4</code> has the appropriate commit (TODO)</p>

<h2 id="setting-up-with-uefi-sd-card">Setting up with UEFI, SD card</h2>

<p>This process is similar to above with TFTP. The SD card should have one or more partitions, the first one must be ext2 and have the file files on it. (If required, you can change the 1:1 in the below commands to 1:2, 1:3 etc for using 2nd, 3rd, partition, etc).</p>

<p>Copy your <code class="language-plaintext highlighter-rouge">sel4img</code> aforementioned in UEFI section to SD card.</p>

<h3 id="manual">Manual</h3>

<p>Drop to a U-Boot console and type in:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ext2load mmc 1:1 ${kernel_addr_r} sel4img
bootefi ${kernel_addr_r}
</code></pre></div></div>

<h3 id="automated">Automated</h3>

<p>Create <code class="language-plaintext highlighter-rouge">boot.scr</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ext2load mmc 1:1 ${kernel_addr_r} sel4img
bootefi ${kernel_addr_r}
</code></pre></div></div>

<p>Convert to uImage using <code class="language-plaintext highlighter-rouge">mkimage -A arm -T script -C none -n boot.scr -d boot.scr boot.scr.uimg</code>. Put in SD card and boot.</p>

    </div>
  </div>
</div>

    </main>
    


<footer class="site-footer">

  <h2 class="footer-heading">seL4 docs</h2>

  <div class="footer-col-wrapper">

    <div class="col-md-2">
      



<ul class="social-media-list">
  <li><a href="https://github.com/sel4"><i class="fab fa-github"></i> <span class="username">sel4</span></a></li><li><a href="https://github.com/sel4proj"><i class="fab fa-github"></i> <span class="username">sel4proj</span></a></li>
</ul>

    </div>

    <div class="col-md-8">
      <ul class="list-unstyled">
        <li>
          This site is for displaying seL4 related documentation.  Pull requests are welcome.
        </li>
        
          <li>
            Site last updated: Fri Feb 7 10:17:38 2025 +1100 ee78c8857c
          </li>
          <li>
                Page last updated: Thu Nov 11 11:50:06 2021 +1100 5fc78c1c47
          </li>
        
      </ul>
    </div>
    <div class="col-md-2">
<a href="https://github.com/seL4/docs/blob/master/Hardware/rockpro64.md">View page on GitHub</a>
      <br />
      <a href="https://github.com/seL4/docs/edit/master/Hardware/rockpro64.md">Edit page on GitHub</a>
      <br />
      <a href="/sitemap">Sitemap</a>
    </div>

  </div>

</footer>

  </body>
</html>
